const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(
    createProxyMiddleware("/event-management", {
      target: 'http://10.136.107.95:8081/',
      changeOrigin: true, // needed for virtual hosted sites
      ws: true, // proxy websockets
      pathRewrite: {
        "^/event-management": "/event-management"
      }
    }),
    createProxyMiddleware("/xianOps", {
      target: 'https://www.fastmock.site/mock/66074e67310084dd171982d23500cab4/',
      changeOrigin: true, // needed for virtual hosted sites
      ws: true, // proxy websockets
      pathRewrite: {
        "^/xianOps": "/xianOps"
      }
    })          
  );
};

